package com.cencat.order.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 订单更新DTO
 * @author cencat
 * @description 固定商家场景多租户SaaS企业综合管理系统订单更新DTO
 * @since 2024-01-01
 */
@Data
@Schema(description = "订单更新DTO")
public class OrderUpdateDTO {

    @Schema(description = "订单ID", required = true)
    @NotNull(message = "订单ID不能为空")
    private Long orderId;

    @Schema(description = "租户ID", required = true)
    @NotNull(message = "租户ID不能为空")
    private Long tenantId;

    @Schema(description = "收货人姓名")
    @Size(max = 50, message = "收货人姓名长度不能超过50个字符")
    private String receiverName;

    @Schema(description = "收货人手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String receiverPhone;

    @Schema(description = "收货地址")
    @Size(max = 200, message = "收货地址长度不能超过200个字符")
    private String receiverAddress;

    @Schema(description = "省份")
    @Size(max = 20, message = "省份长度不能超过20个字符")
    private String province;

    @Schema(description = "城市")
    @Size(max = 20, message = "城市长度不能超过20个字符")
    private String city;

    @Schema(description = "区县")
    @Size(max = 20, message = "区县长度不能超过20个字符")
    private String district;

    @Schema(description = "邮政编码")
    @Pattern(regexp = "^\\d{6}$", message = "邮政编码格式不正确")
    private String postalCode;

    @Schema(description = "订单备注")
    @Size(max = 500, message = "订单备注长度不能超过500个字符")
    private String orderRemark;

    @Schema(description = "配送方式")
    private String deliveryMethod;

    @Schema(description = "期望配送时间")
    private LocalDateTime expectedDeliveryTime;

    @Schema(description = "订单状态")
    private String orderStatus;

    @Schema(description = "支付状态")
    private String paymentStatus;

    @Schema(description = "配送状态")
    private String deliveryStatus;

    @Schema(description = "更新原因")
    @Size(max = 200, message = "更新原因长度不能超过200个字符")
    private String updateReason;
}